package cn.school.student.common.enumdir;

import lombok.Getter;

@Getter
public enum StudentTypeEnum {

    design("设计",0),
    webDesign("前端",1),
    backend("后端",2);

    StudentTypeEnum(String label,Integer value){
        this.label=label;
        this.value=value;
    }

    private String label;

    private Integer value;

    //通过label获取对应的枚举实例
    public static StudentTypeEnum getByLabel(String name) {
        StudentTypeEnum [] list = values();
        for (StudentTypeEnum studentTypeEnum : list) {
            if ((studentTypeEnum.label).equals(name)) {
                return studentTypeEnum;
            }
        }
        return null;
    }

}
